function N = reference_basis_function_1d(basis_type)

switch basis_type
    case "P1"
        N = cell(2,1);
        % (0,1)区域
        % N{1} = @(xi) 1 - xi;
        % N{2} = @(xi) xi;
        % (-1,1)区域
        N{1} = @(xi) 0.5 - 0.5*xi;
        N{2} = @(xi) 0.5 + 0.5*xi;

    case "P1b"
        N = cell(3,1);
        % (0,1)区域
        % N{1} = @(xi) 1 - xi;
        % N{2} = @(xi) xi;
        % (-1,1)区域
        N{1} = @(xi) 0.5 - 0.5*xi;
        N{2} = @(xi) 0.5 + 0.5*xi;
        N{3} = @(xi) 4*N{1}(xi).*N{2}(xi);

    case "P2"
        N = cell(3,1);
        % (0,1)区域
        % N{1} = @(xi) 1 - 3.*xi + 2.*xi.^2;
        % N{3} = @(xi) 4.*xi - 4.*xi.^2;
        % N{2} = @(xi) -xi + 2.*xi.^2;
        % (-1,1)区域
        N{1} = @(xi) -0.5*xi + 0.5*xi.^2;
        N{3} = @(xi) 1 - xi.^2;
        N{2} = @(xi) 0.5*xi + 0.5*xi.^2;

    case "P3"
        N = cell(4,1);
        % (0,1)区域
        % N{1} = @(xi) -4.5.*xi.^3 + 9.*xi.^2 - 5.5.*xi + 1;
        % N{3} = @(xi) 13.5.*xi.^3 - 22.5.*xi.^2 + 9.*xi;
        % N{4} = @(xi) -13.5.*xi.^3 + 18.*xi.^2 - 4.5.*xi;
        % N{2} = @(xi) 4.5.*xi.^3 - 4.5.*xi.^2 + xi;
        % (-1,1)区域
        N{1} = @(xi) -0.0625 + 0.0625*xi + 0.5625*xi.^2 - 0.5625*xi.^3;
        N{3} = @(xi) 0.5625 - 1.6875*xi - 0.5625*xi.^2 + 1.6875*xi.^3;
        N{4} = @(xi) 0.5625 + 1.6875*xi - 0.5625*xi.^2 - 1.6875*xi.^3;
        N{2} = @(xi) -0.0625 - 0.0625*xi + 0.5625*xi.^2 + 0.5625*xi.^3;

    case "P4"
        N = cell(5,1);
        % (0,1)区域
        % N{1} = @(xi) 1 - 25/3*xi + 70/3*xi.^2 - 80/3*xi.^3 + 32/3*xi.^4;
        % N{2} = @(xi) 16*xi - 208/3*xi.^2 + 96*xi.^3 - 128/3*xi.^4;
        % N{3} = @(xi) -12*xi + 76*xi.^2 - 128*xi.^3 + 64*xi.^4;
        % N{4} = @(xi) 16/3*xi - 112/3*xi.^2 + 224/3*xi.^3 - 128/3*xi.^4;
        % N{5} = @(xi) -1*xi + 22/3*xi.^2 - 16*xi.^3 + 32/3*xi.^4;
        % (-1,1)区域
        N{1} = @(xi) 1/6*xi - 1/6*xi.^2 - 2/3*xi.^3 + 2/3*xi.^4;
        N{3} = @(xi) -4/3*xi + 8/3*xi.^2 + 4/3*xi.^3 - 8/3*xi.^4;
        N{4} = @(xi) 1 - 5*xi.^2 + 4*xi.^4;
        N{5} = @(xi) 4/3*xi + 8/3*xi.^2 - 4/3*xi.^3 - 8/3*xi.^4;
        N{2} = @(xi) -1/6*xi - 1/6*xi.^2 + 2/3*xi.^3 + 2/3*xi.^4;

    otherwise
        error("Invalid basis type.")
end

end